@extends('manager._layouts.default')
 
@section('main')
 
    <h2>Create new product</h2>
 
    {{ Form::open(array('route' => 'manager.products.store')) }}
        <div class="row">
            <div class="row col-lg-12">
                <div class="form-group col-lg-6">
                    <label for="name">Product Name</label>
                    <input type="text" id="name" name="name" value="" class="newproduct form-control">
                </div>
                <div class="form-group col-lg-3">
                    <label for="slug">Slug</label>
                    <i class="fa fa-fw fa-question-circle help" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="This is the friendly URL of the page" data-container="body"></i>
                    <input type="text" id="slug" name="slug" value="" class="form-control">
                </div>
            </div> 
        </div>

        <ul class="nav nav-tabs">
            <li class="active"><a href="#content" data-toggle="tab">Content</a></li>
            <li><a href="#general" data-toggle="tab">Settings</a></li>
            <li><a href="#images" data-toggle="tab">Images</a></li>
            <li><a href="#files" data-toggle="tab">Files</a></li>
            <li><a href="#relatedproducts" data-toggle="tab">Related Products</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="content">
                <label for="product-shortdescription">Short Description</label>
                <textarea name="shortdescription" id="product-shortdescription-editor" class="form-control"></textarea>
                <p>&nbsp;</p>

                <label for="product-description">Description</label>
                <textarea name="description" id="product-description-editor" class="form-control"></textarea>
                <p>&nbsp;</p>
                
				<input type="hidden" name="numattributes" id="numattributes" value="0">
				
				<div class="row" id="addattributerow">
					<div class="col-lg-3">
						<label for="productattribute">Select existing Attribute</label>
						{{ Form::select('productattribute', $product_attributes, null, array("class"=>"form-control", "id"=>"productattribute")) }}
					</div>
					<div class="col-lg-3">
						<label for="newproductattribute">or Enter new Attribute</label>
						<input type="text" id="newattribute" name="newattribute" value="" class="form-control">
					</div>
					<div class="col-lg-6">
						<label>&nbsp;</label><br>
						<button id="addattributebutton" type="button" class="btn btn-primary"><i class="fa fa-fw fa-plus"></i> Add</button>
					</div>
				</div>
				
				<div id="newattributetemplate" style="display:none">
					<div class="!customattribute!">
						<label>@attributename@ <a class="btn btn-danger btn-xxs removeattributebutton" href="#" title="Delete attribute"><i class="fa fa-fw fa-trash-o"></i></a></label>
						<input type="hidden" name="attribute@num@" value="@attributeid@">
						<input type="hidden" name="attributename@num@" value="@attributename@">
						<textarea name="content@num@" class="form-control !attributecontent!"></textarea>
						<p>&nbsp;</p>
					</div>
				</div>
            </div>
            <div class="tab-pane" id="general">
               <div class="row">
                    <div class="form-group col-lg-2">
                        <label for="status">Status</label>
                        {{ Form::select('status', array("0"=>"Hidden", "1"=>"Active"), null, array("class"=>"form-control")) }}
                    </div>
                    <div class="form-group col-lg-4">
                        <label for="categoryid[]">Product Categories</label>
                        {{ $product_categories }}
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="images">
                <p>Please save the product before uploading any images</p>
            </div>
            <div class="tab-pane" id="files">
                <p>Please save the product before uploading any files</p>
            </div>
            <div class="tab-pane" id="relatedproducts">
                <p>Please save the product before choosing related products</p>
            </div>
        </div>

        
        <div class="row">
            <div class="col-lg-12">
                <button type="submit" class="btn btn-primary btn-large">Save</button>
                <a href="{{ URL::route('manager.products.index') }}" class="btn btn-default btn-large">Cancel</a>
            </div>        
            
        </div>
 
    {{ Form::close() }}
 
@stop